COHelp

ComboONE.BMP (48054 Byte) by

Have you ever seen in a program a ComboBox which includes much more features than the ComboBox in Visual Basic?

So have a look at the ultimate ComboOne -
The last resort of your dreamless nights!

ComboONE is a combo control which enables you to track much more events than the regular visual basic combo.

Something about the new features:
2 more styles. The first style offers the possbility to supplement the datas depending on the entered letters. In this case the selection can only be an item of the ListBox Portion. The second style allowes to add new entries to the ComboONE.

At least many other features are supported like the SelChange-function often missed by the regular ComboBox.

Vistit http://www.theprocompanies.com for updates or other utilities.


AddItem Method

BackColor, ForeColor Properties

This property controls the background color of an object. Colors may be specified as RGB values or system default colors.

Syntax

dbpCombo1.BackColor = color

Read/Write at run time and design time.

The Backcolor / Forecolor methods syntax have these parts:

Part

Description
dbpCombo1 An instance of an ComboOne control.
Color
A value or constant that determines the background or foreground colors of ComboONE.
Copyright (c) 1998 DBPro - Database Solutions for Professionals GmbH


AddItem Method

Font Property

Sets or returns a Font object.

Syntax

object.Font [ = Font ]

Part

Description
object | An object expression that evaluates to an instance of ComboONE.
font | Required. Font object.

Remarks

Use the Font property of an object to identify a specific Font object whose properties you want to use. For example, the following code changes the Bold property setting of a Font object identified by the Font property of a ComboONE object:

dbpCombo1.Font.Bold = True


AddItem Method

Enabled Property

Returns or sets a value that determines whether a form or control can respond to user-generated events.

Syntax

object.Enabled [= boolean]

The Enabled method syntax has these parts:

Part

Description

Object

An object expression that evaluates to an instance of ComboONE.

Boolean

A Boolean expression that specifies whether object can respond to user-generated events.


AddItem Method

List Property

Returns or sets the items contained in a control's list portion. The list is a string array in which each element is a list item.

Syntax

object.List(index) [ = string ]

The List property syntax has these parts;

Part

Description
object | An object expression that evaluates to an instance of ComboONE.
index | The number of a specific item in the list.
string | A string expression specifying the list item.

Remarks

Use this property to access list items.

Note To specify items you want to display in a ComboONE control, use the AddItem method. To remove items, use the RemoveItem method. To keep items in alphabetic order, set the control's Sorted property to True before adding items to the list.


AddItem Method

ListCount Property

Returns the number of items in the list portion of a control.

Syntax

object.ListCount


AddItem Method

ListIndex Property

Returns or sets the index of the currently selected item in the ComboONE. Not available at design time.

Syntax

object.Listindex [ = index ]

The List property syntax has these parts;

Part

Description
object | An object expression that evaluates to an instance of ComboONE.
index | A numeric expression specifying the index of the current item, as described in Settings.

Remarks

The expression dboCombo1.List(dbpCombo1.ListIndex) returns the string for the currently selected item.

The first item in the list is ListIndex = 0, and ListCount is always one more than the largest ListIndex value.

ListIndex value set to -1indicates that no item if the list has been selected.


AddItem Method

OpenSeekList Property

Determines if ComboONE opens its listbox portion when entering data.

Syntax

dbpCombo1.Listindex [ = boolean ]

The List property syntax has these parts;

Part

Description
dbpCombo1 | An object expression that evaluates to an instance of ComboONE.
boolean | If set to true, list box portion open when hitting a key.

Remarks

The OpenSeeklist property has only effect, if Style property is set to:

3 - OpenSeekList or
4 - OpenSeekListInsertable


AddItem Method

Style Property

Determines the behaviour of the control.

Syntax

dbpCombo1.Style [ = Combostyle ]

The List property syntax has these parts;

Part

Description
dbpCombo1 | An instance of an ComboOne control.
ComboStyle | If set to true, list box portion open when hitting a key.

Combo Box Styles

There are five ComboONE styles. Each style can be set at either design or run time and uses values, or equivalent Visual Basic constants, to set the style of the combo box.

Style | Value | Constant
Drop-down combo box | 0 | DropDownCombo
Simple combo box | 1 | DropDownSimple
Drop-down list box | 2 | DropDownList
Searchable Combo | 3 | DropDownSeekList
like 3, but allows new entries | 4 | DropDownSeekInsertable

Further Information:

Drop-down Combo Box
With the default setting (Style = 0 – DropdownCombo), a combo box is a drop-down combo box. The user can either enter text directly (as in a text box) or click the detached arrow at the right of the combo box to open a list of choices. Selecting one of the choices inserts it into the text portion at the top of the combo box. The user also can open the list by pressing ALT+ DOWN ARROW when the control has the focus.

Simple Combo Box
Setting the Style property of a combo box to 1 – DropDownSimple specifies a simple combo box in which the list is displayed at all times. To display all entries in the list, you must draw the list box large enough to display the entries. A vertical scroll bar is automatically inserted when there are more entries than can be displayed. The user can still enter text directly or select from the list. As with a drop-down combo box, a simple combo box also allows users to enter choices not on the list.

Drop-down List Box
A drop-down list box (Style = 2 – DropDownList) is like a regular list box — it displays a list of items from which a user must choose. Unlike list boxes, however, the list is not displayed until you click the arrow to the right of the box. The key difference between this and a drop-down combo box is that the user can't type into the box, he can only select an item from the list. Use this type of list box when space is at a premium.

Drop-down SeekList
A drop-down SeekList (Style = 3 - DropDownSeekList) is similar to a Drop-down List Box. But the user is only allowed to enter a text in the ComboOne Box which is an item of the Listbox Portion.

Drop-downSeekInsertable
By using the 4, setting (Style = 4 – DropDownSeekInsertable) the combo box is like a Drop-down SeekList with the extension to enter datas which are not in the Listbox Portion.

Remarks

For the ComboOne control, follow these guidelines in deciding which setting to choose:

  • Use setting 0 (DropDownCombo) or setting 1 (DropDownSimple) to give the user a list of choices. Either style enables the user to enter a choice in the text box. Setting 0 saves space on the form because the list portion closes when the user selects an item.

  • Use setting 2 (DropDownList) to display a fixed list of choices from which the user can select one. The list portion closes when the user selects an item.


Click Event

Occurs when the user presses and then releases a mouse button over an object. It can also occur when the value of a control is changed.

For a Form object, this event occurs when the user clicks either a blank area or a disabled control. For a control, this event occurs when the user selects an item in a ComboOne control, either by pressing the arrow keys or by clicking the mouse button.

Syntax

Private Sub dbpCombo1_Click([index As Integer])

The Click event syntax has these parts:

Part | Description
dbpCombo1 | An instance of an ComboOne control.
index | An integer that uniquely identifies a control if it's in a control array.

Note To distinguish between the left, right, and middle mouse buttons, use the MouseDown and MouseUp events.

Remark

If there is code in the Click event, the DblClick event will never trigger, because the Click event is the first event to trigger between the two. As a result, the mouse click is intercepted by the Click event, so the DblClick event doesn't occur.


Change Event

Indicates the contents of a control have changed. Sent any time the contents of the edit control part of a combo control change. The message is sent after the changes have already been displayed.

Syntax

Private Sub dbpCombo1_Change([index As Integer])

The Change event syntax has these parts:

Part | Description
dbpCombo1 | An instance of an ComboOne control.
index | An integer that uniquely identifies a control if it's in a control array.

Remarks

The Change event procedure can synchronize or coordinate data display among controls.


SelChange Event

This message is sent any time the selection in the list control part of a ComboOne control changes.

Syntax

Private Sub dbpCombo1_SelChange()

The SelChange event syntax has these parts:

Part | Description
dbpCombo1 | An instance of an ComboOne control.


AddItem Method

Adds an item ComboONE control. Doesn't support named arguments.

Syntax

dbpCombo1.AddItem item, index

The AddItem method syntax has these parts:

Part

Description
dbpCombo1 | An instance of an ComboOne control.
item | Required. string expression specifying the item to add to the object.
index | Optional. Integer specifying the position within the object where the new item or row is placed.

Remarks

If you supply a valid value for index, item is placed at that position within the object. If index is omitted, item is added at the proper sorted position (if the Sorted property is set to True) or to the end of the list (if Sorted is set to False).


Clear Method

Clears the contents of a ComboOne.

Syntax

dbpCombo1.Clear


RemoveItem Method

Removes an item from a ComboOne control.

Syntax

dbpCombo1.RemoveItem index

The RemoveItem method syntax has these parts:

Part | Description
dbpCombo1 | Required. An instance of an ComboOne control.
index | Required. Integer representing the position within the object of the item or row to remove. For the first item in a ComboOne control, index = 0.


Constants

Used with

Style (DBPCombo)

Value Constant
0 DropDownCombo
1 DropDownSimple
2 DropDownList
3 DropDownSeekList
4 DropDownSeekInsertable


Trademark acknowledgements:

"ComboOne V 1.0" is a trademark of DBPro Database Solutions for Professoinals GmbH. References to other companies and their products use trademarks owned by the respective companies and are for reference purposes only.